package top.csy8888.work1.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import top.csy8888.work1.controller.vo.ResultVO;
import top.csy8888.work1.entity.City;
import top.csy8888.work1.service.CityService;

import java.util.List;

/**
 * @author CSY
 * @date 2025 - 09 - 12
 */
@RestController
@RequestMapping("city")
public class CityController extends BaseController {
    @Autowired
    private CityService cityService;

    @GetMapping("/list")
    public ResultVO<List<City>> listCity(@RequestParam("pageNum") Integer pageNum,
                                         @RequestParam("pageSize") Integer pageSize) {
        List<City> cities = cityService.listCity(pageNum, pageSize);
        return success(cities);
    }
}
